using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
class MyForm:Form
{
	readonly Button btnLarger,btnSmaller;
	readonly int cxBtn,cyBtn,dxBtn;
	public MyForm()
	{
		Text="Two Buttons";
		ResizeRedraw=true;
		
		cxBtn=5*Font.Height;
		cyBtn=2*Font.Height;
		dxBtn=Font.Height;

		btnLarger=new Button();
		btnLarger.Parent=this;
		btnLarger.Size=new Size(cxBtn,cyBtn);
		btnLarger.Text="&Larger";
		btnLarger.Click+=new EventHandler(btnLarger_Click);
		btnLarger.FlatStyle=FlatStyle.Flat;
//		btnLarger.Image=new Bitmap(GetType(),"larger_and_smaller.Bitmap1.bmp");
//		btnLarger.Paint+=new PaintEventHandler(ButtonOnPaint);
//		btnLarger.Anchor=AnchorStyles.Top|AnchorStyles.Left;
//		btnLarger.Location=new Point(dxBtn,dxBtn);
		btnLarger.Dock=DockStyle.Top;



//		btnSmaller=new Button();
//		btnSmaller.Parent=this;
//		btnSmaller.Size=new Size(cxBtn,cyBtn);
//		btnSmaller.Text="&Smaller";
//		btnSmaller.Click+=new EventHandler(btnSmaller_Click);
//		btnSmaller.FlatStyle=FlatStyle.System;;
//		btnSmaller.Paint+=new PaintEventHandler(ButtonOnPaint);

//		OnResize(EventArgs.Empty);



	}
//	protected override void OnResize(EventArgs e)
//	{
//		btnLarger.Location=new Point(ClientSize.Width/2-cxBtn-dxBtn/2,(ClientSize.Height-cyBtn)/2);
//		btnSmaller.Location=new Point(ClientSize.Width/2+dxBtn/2,(ClientSize.Height-cyBtn)/2);
//		base.OnResize (e);
//	}


	private void btnLarger_Click(object sender, EventArgs e)
	{
		Top-=(int)(0.05*Width);
		Left-=(int)(0.04*Height);
		Width+=(int)(0.10*Width);
		Height+=(int)(0.10*Width);

	}

	private void btnSmaller_Click(object sender, EventArgs e)
	{
		Top+=(int)(0.05*Width);
		Left+=(int)(0.04*Height);
		Width-=(int)(0.10*Width);
		Height-=(int)(0.10*Width);

	}

	private void ButtonOnPaint(object sender, PaintEventArgs e)
	{
		Button btn=(Button)sender;
		Graphics grfx=e.Graphics;
		grfx.DrawString("OwerDraw",Font,Brushes.Red,0,0);
		ControlPaint.DrawButton(grfx,0,0,cxBtn,cyBtn,
			btn.Capture?ButtonState.Pushed:ButtonState.Normal);
//			(btn==(Button)(GetChildAtPoint(PointToClient(MousePosition))				)
//			&&btn.Capture?ButtonState.Pushed:ButtonState.Normal));

		GraphicsState grfxState=grfx.Save();

//		grfx.TranslateTransform(cxBtn/2,cyBtn/2);
		grfx.DrawRectangle(Pens.Red,0,0,Font.Height,Font.Height);

		if(btn.Focused)
			ControlPaint.DrawFocusRectangle(grfx,btn.ClientRectangle);



	}
}
class APP
{
	static void Main()
	{
		Application.Run(new MyForm());
	}
}